import { createForm } from '@formily/core';
import { Field } from '@formily/react';
import 'antd/dist/antd.css';
import { Form, FormItem, Input, NumberPicker } from '@formily/antd';
//纯JSX
const form = createForm();
function App() {
  return (
    <Form form={form} labelCol={6} wrapperCol={5}>
      <Field
        name="name"
        title="姓名"
        required
        component={[Input, {}]}
        decorator={[FormItem, {}]}
      />
      <Field
        name="age"
        title="年龄"
        required
        component={[NumberPicker, {}]}
        decorator={[FormItem, {}]}
      />
    </Form>
  )
}
export default App